package pkg.deberes;

import java.awt.event.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;


public class Ejercicio2 extends JFrame{

private JLabel label= new JLabel();
private JTextField texto= new JTextField();
private JButton boton= new JButton();

public Ejercicio2()
{
	this.setSize(500, 300);
	this.addWindowListener(new acabar());
	setLayout(null);
    label=new JLabel("Numero 1:");
    label.setBounds(30,10,100,30);
    add(label);
    texto=new JTextField("0");
    texto.setBounds(130,17,100,20);
    add(texto);
    label=new JLabel("Numero 2:");
    label.setBounds(30,45,100,30);
    add(label);
    texto=new JTextField("0");
    texto.setBounds(130,52,100,20);
    add(texto);
    boton=new JButton("Sumar");
    boton.setBounds(25,100,100,20);
    add(boton);
    boton=new JButton("Restar");
    boton.setBounds(160,100,100,20);
    add(boton);
	}

public class acabar extends WindowAdapter
{
	public void closingWindow(WindowEvent e)
	{
		System.exit(0);
	}
	}

}
